import request from '@/utils/request'

// 查询慈航公益列表
export function listCharity(query) {
  return request({
    url: '/Community/charity/list',
    method: 'get',
    params: query
  })
}

// 查询慈航公益详细
export function getCharity(id) {
  return request({
    url: '/Community/charity/' + id,
    method: 'get'
  })
}

// 新增慈航公益
export function addCharity(data) {
  return request({
    url: '/Community/charity',
    method: 'post',
    data: data
  })
}

// 修改慈航公益
export function updateCharity(data) {
  return request({
    url: '/Community/charity',
    method: 'put',
    data: data
  })
}

// 删除慈航公益
export function delCharity(id) {
  return request({
    url: '/Community/charity/' + id,
    method: 'delete'
  })
}
// 消息状态修改
export function changeNoticeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/Community/charity/changeStatus',
    method: 'put',
    data: data
  })
}

// 置顶状态修改
export function changeIsCarouselStatus(id, isCarousel) {
  const data = {
    id,
    isCarousel
  }
  return request({
    url: '/Community/charity/changeIsCarouselStatus',
    method: 'put',
    data: data
  })
}

// 进度显示状态修改
export function changeShowStatusStatus(id, showStatus) {
  const data = {
    id,
    showStatus
  }
  return request({
    url: '/Community/charity/changeShowStatus',
    method: 'put',
    data: data
  })
}

